function fontSize() { let doc = document.documentElement, resizeEvt = "orientationchange" in window ? "orientationchange" : "resize", recalc = function () { let winW = doc.clientWidth, size; if (!winW) return; if(winW <= 480){ size = Math.round(winW / 7.5); }else if (winW <= 768) { size = Math.round(winW / 10.5); if (size > 65) { size = 65; } } else if(winW <= 1200){ size = Math.round(winW / 13); } else if (winW <= 1800) { size = Math.round(winW / 16); } else { size = 100; }; doc.style.fontSize = size + 'px'; }; if (!document.addEventListener) return; window.addEventListener(resizeEvt, recalc, false); document.addEventListener("DOMContentLoaded", recalc, false); }; fontSize(); const userBrowser = (function () { const ua = navigator.userAgent; const testUa = function (regexp) { return regexp.test(ua.toLowerCase()) }; let userBrowserClient = function () { let client = ''; if (/(iPhone|iPad|iPod|iOS)/i.test(ua)) { client = 'iOS'; } else if (/(Android)/i.test(ua)) { client = 'Android'; } else { client = 'PC'; } return client; }; let userBrowserType = function () { let shell = "none"; let shellVs = "unknow"; if (testUa(/micromessenger/g)) { shell = "wechat"; // 寰俊娴忚鍣 } else if (testUa(/qqbrowser/g)) { shell = "qq"; // QQ娴忚鍣 } else if (testUa(/ubrowser/g)) { shell = "uc"; // UC娴忚鍣 } else if (testUa(/qihu 360se/g)) { shell = "360"; // 360娴忚鍣 } else if (testUa(/2345explorer/g)) { shell = "2345"; // 2345娴忚鍣 } else if (testUa(/metasr/g)) { shell = "sougou"; // 鎼滅嫍娴忚鍣 } else if (testUa(/lbbrowser/g)) { shell = "liebao"; // 鐚庤惫娴忚鍣 } else if (testUa(/maxthon/g)) { shell = "maxthon"; // 閬ㄦ父娴忚鍣 } return shell }; return { userBrowserClient: userBrowserClient, userBrowserType: userBrowserType } })(); function dynamicLoadJs(url, callback) { var head = document.getElementsByTagName('head')[0]; var script = document.createElement('script'); script.type = 'text/javascript'; script.src = url; script.defer = 'defer'; if (typeof (callback) === 'function') { script.onload = script.onreadystatechange = function () { if (!this.readyState || this.readyState === 'loaded' || this.readyState === 'complete') { callback(); script.onload = script.onreadystatechange = null; } } } head.appendChild(script); } if (userBrowser.userBrowserClient() == 'PC') { try { eval('()=>{}'); } catch (eo) { dynamicLoadJs("js/polyfill/polyfill.min.js"); }; };